package com.i2works.smartluolong.utils.shiro;

import com.i2works.smartluolong.utils.base.LoginType;
import org.apache.shiro.authc.UsernamePasswordToken;

/**
 * 登录token
 *
 * @author Liu Yutao <koal@vip.qq.com>
 * @date 2018/7/3 16:44
 */

public class SmartLuoLongToken extends UsernamePasswordToken {

    private LoginType type;

    public SmartLuoLongToken() {
        super();
    }

    public SmartLuoLongToken(String username, String password, LoginType type, boolean rememberMe, String host) {
        super(username, password, rememberMe, host);
        this.type = type;
    }

    /**
     * 免密登录
     */
    public SmartLuoLongToken(String username) {
        super(username, "", false, null);
        this.type = LoginType.NOPASSWD;
    }

    /**
     * 账号密码登录
     */
    public SmartLuoLongToken(String username, String password) {
        super(username, "", false, null);
        this.type = LoginType.PASSWORD;
    }

    public LoginType getType() {
        return type;
    }

    public void setType(LoginType type) {
        this.type = type;
    }
}


